package network.enums;

public enum ClientPackets { GameList(0), RemoveRoom(1), UpdatePlayers(2), LoginAccepted(3), LoginFailed(4),
	ServerMessage(5), Banned(6), Kicked(7), RegisterAccept(8), RegisterFailed(9), Pong(10), RoomStart(11),
	UserList(12), AddUser(13), RemoveUser(14), FriendList(15), JoinChannelAccept(16), Message(17), DuelRequest(18),
	DevPoints(19), UserStats(20), TeamStats(21), TeamList(22), AcceptDuelRequest(23), RefuseDuelRequest(24),
	StartDuel(25), JoinTeamRequest(26), RemovedFromTeam(27), LeaveTeam(28), GameServers(29), RemoveServer(30), AddServer(31),
	ChannelList(32);
private int value;

private ClientPackets(int value) 
{
        this.value = value;
}
public int getValue()
{
	return value;
}
public static ClientPackets fromInt(int code) {
	
	switch(code) 
	{
		case 0:
			return GameList;
		case 1:
			return RemoveRoom;
		case 2:
			return UpdatePlayers;
		case 3:
			return LoginAccepted;
		case 4:
			return LoginFailed;
		case 5:
			return ServerMessage;
		case 6:
			return Banned;
		case 7:
			return Kicked;
		case 8:
			return RegisterAccept;
		case 9:
			return RegisterFailed;
		case 10:
			return Pong;
		case 11:
			return RoomStart;
		case 12:
			return UserList;
		case 13:
			return AddUser;
		case 14:
			return RemoveUser;
		case 15:
			return FriendList;
		case 16:
			return JoinChannelAccept;
		case 17:
			return Message;
		case 18:
			return DuelRequest;
		case 19:
			return DevPoints;
		case 20:
			return UserStats;
		case 21:
			return TeamStats;
		case 22:
			return TeamList;
		case 23:
			return AcceptDuelRequest;
		case 24:
			return RefuseDuelRequest;
		case 25:
			return StartDuel;
		case 26:
			return JoinTeamRequest;
		case 27:
			return RemovedFromTeam;
		case 28:
			return LeaveTeam;
		case 29:
			return GameServers;
		case 30:
			return RemoveServer;
		case 31:
			return AddServer;
		case 32:
			return ChannelList;
		}
	return null;
}

}
